package sncf;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class HMI implements ActionListener{
	public FenetreSaisie fs;
	public FenetreResult fr;
	private static HMI instance;
	private Controler ctr;
	
	private HMI(Controler ctr)
	{
		this.ctr = ctr;
		fs = new FenetreSaisie(ctr);
		fr = new FenetreResult(ctr);
		fs.setVisible(true);
		fr.setVisible(false);
	}
	
	public static HMI getInstance(Controler ctr){
		if (instance == null){
			instance = new HMI(ctr);
			return instance;
		}
		else {
			instance.ctr = ctr;
			return instance;
		}			
	}
	
	public void showFenetreSaisie(){
		this.fs.setVisible(true);
		this.fr.setVisible(false);
	}
	
	public void showFenetreResult(){
		// TODO Refresh fenetreResult
		
		this.fr.setVisible(true);
		this.fs.setVisible(false);
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		
		
	}
	

}
